package com.haidong;

import com.haidong.dao.BookDao;
import com.haidong.dao.impl.BookDaoImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;

public class App {
    public static void main(String[] args) {
        ApplicationContext ctx = new
                ClassPathXmlApplicationContext("applicationContext.xml");

        DataSource dataSource = (DataSource) ctx.getBean("dataSource");
        System.out.println(dataSource);
//        DataSource dataSource2 = (DataSource) ctx.getBean("dataSource2");
//        System.out.println(dataSource2);
        BookDao bookDao = (BookDao) ctx.getBean("bookDao");
        bookDao.run();
    }
}
